﻿using Catel.Articles._02___WPF_controls.UI.Windows;
using Catel.Articles.Base.Data.Attributes;
using Catel.Articles.Base.UI;

namespace Catel.Articles._02___WPF_controls.Examples.Validation
{
    [Example("Validation", "Example of the validation controls",
        LongDescription = @"There are 2 validation controls in Catel: InfoBarMessageControl and WarningAndErrorValidator.

The InfoBarMessageControl is the yellow bar at the top of windows, controls, etc that shows the errors currently in the view.

The WarningAndErrorValidator enables business errors, field warnings and business warnings inside the InfoBarMessageControl as well.",
        SourceFileName = "/Examples/Validation/Code.txt",
        ImageUri = "/Examples/Validation/Screenshot.png",
        ClickHandlerName = "ShowExample")]
    public class Example
    {
        /// <summary>
        /// Shows the example.
        /// </summary>
        private static void ShowExample()
        {
            // Show person window (which uses the DataWindow, that includes the validation controls)
            PersonWindow personWindow = new PersonWindow();
            personWindow.ShowDialog();
        }
    }
}
